#ifndef _CAPP_H_
#define _CAPP_H_

#include <SDL/SDL.h>
#include <SDL_ttf/SDL_ttf.h>
#include <SDL_mixer/SDL_mixer.h>
#include "classes/CEvent.h"
#include "classes/CSurface.h"
#include "classes/CMap.h"
#include "classes/CAnimation.h"
#include "classes/CEntity.h"
#include "classes/CBowser.h"
#include "classes/CCamera.h"
#include "classes/CSound.h"
#include "classes/CScore.h"
#include <string.h>

enum {
	START = 0,
    RUNNING,
	PAUSE,
	SCORE,
	END
};

class CApp : public CEvent {

private:
	int				EtatJeu;

	SDL_Surface*    Surf_Display;
	SDL_Surface*    StartImage;
	SDL_Surface*	Surf_Background1;
    SDL_Surface*    Surf_Background2;
    SDL_Surface*    Surf_Background3;
    SDL_Surface*    Surf_Background4;
    
	SDL_Surface*    HUD_Fond;
    SDL_Surface*    HUD_Life;
    SDL_Surface*    HUD_Coin;
	SDL_Surface*    HUD_Timer;

	CMap Map;
    CBowser Bowser;
    CEntity Ryu;
    CSound Mixer;
    SDL_Event Event;

	long timeDebutNiveau;
	long timerNiveau;
	char* nomJoueur;
	std::vector<CScore*> listeScores;

public:
	CApp();
	int OnExecute();

private:	
	bool OnInit();
	void OnStart();
	bool OnMapLoad();
	void OnEvent(SDL_Event* SDLEvent);
	void OnExit();
	void OnLoop();
	void OnRender();
	void OnScore();
	void OnCleanup();

    void OnKeyDown(SDLKey sym, SDLMod mod, Uint16 unicode);
    void OnKeyUp(SDLKey sym, SDLMod mod, Uint16 unicode);
	
};
#endif
